﻿
Public Class userAgent
    Public Const functionName As String = "userAgCon"

    Public Shared Sub invoke(ByVal inlineScript As inlineScript, ByVal str As String, ByRef actionTarget As String)
        assert(Not inlineScript Is Nothing, "inlineScript is nothing.")
        inlineScript.addscript(network.http.contentType.textjavascript, "userAgentContains", "function " + functionName _
                               + "(v){return navigator.userAgent.toLowerCase().indexOf(v.toLowerCase())!=-1;}")
        actionTarget += functionName + "(" + str + ")"
    End Sub
End Class

Public Class isIEUserAgent
    Public Shared Sub invoke(ByVal inlineScript As inlineScript, ByRef actionTarget As String)
        assert(Not inlineScript Is Nothing, "inlineScript is nothing.")
        userAgent.invoke(inlineScript, "'msie'", actionTarget)
    End Sub
End Class

Public Class isNotIEUserAgent
    Public Shared Sub invoke(ByVal inlineScript As inlineScript, ByRef actionTarget As String)
        isIEUserAgent.invoke(inlineScript, actionTarget)
        actionTarget = "!" + actionTarget
    End Sub
End Class
